<?php 
$username = array(
		'type'  => 'text',
		'name'	=> 'username',
		'id'	=> 'username',
		'class'	=> 'input-text',
		'placeholder' => 'Username',
		'value' => set_value('username')
);
$password = array(
		'type'  => 'password',
		'name'	=> 'password',
		'id'	=> 'password',
		'class'	=> 'input-text',
		'placeholder' => 'Password'
);
$attributes = array(
		'id'	=> 'login-form',
		'method'=> 'post',
		'class' => 'form-signin'
);
$attributes_forget = array(
		'id'	=> 'forget-form',
		'method'=> 'post',
		'class' => 'form-signin'
);
$form_submits = array(
		'name'	=> 'login',
		'class' => 'brown_btn',
		'value'	=> 'Sign in'
);
// form register
$username_reg = array(
	'name'	=> 'username',
	'id'	=> 'signup_username',
	'size'	=> 30,
	'placeholder' => 'Username',
	'value' =>  set_value('username')
);
$attributes_reg = array(
	'id'	=> 'signup-form',
	'method'=> 'post',
	'class' => 'form-signup'
);
$password_reg = array(
	'name'	=> 'password',
	'id'	=> 'signup_password',
	'size'	=> 30,
	'placeholder' => 'Password',
	'value' => set_value('password')
);

$confirm_password_reg = array(
	'name'	=> 'confirm_password',
	'id'	=> 'signup_confirm_password',
	'size'	=> 30,
	'placeholder' => 'Confirm Password',
	'value' => set_value('confirm_password')
);

$email_reg = array(
	'name'	=> 'email',
	'id'	=> 'signup_email',
	'maxlength'	=> 80,
	'placeholder' => 'E-mail',
	'size'	=> 30,
	'value'	=> set_value('email')
);
$form_submits_reg = array(
	'name'	=> 'register',
	'class' => 'brown_btn',
	'value'	=> 'Register'
);
$forget = array(
	'name'	=> 'login',
	'id'	=> 'login',
	'maxlength'	=> 80,
	'size'	=> 30,
	'value' => set_value('login')
);
?>
<div class="header_container">
	<header>
		<div class="top_bar clear">
			<!--<div class="language_switch"><a class="active" href="#" title="ENGLISH">EN</a> <a href="#" title="FRENCH">FR</a></div>-->
			<ul class="top_links">
				<?php if($this->dx_auth->is_logged_in()){?>
					<li><a href="#" class="miniaccount_link">My Account</a></li>
				<?php }else { ?>
					<li><a href="#" class="minilogin_link">Login</a></li>
					<li class="highlight"><a href="#" class="minisignup_link">Sign Up</a></li>
				<?php } ?>
			</ul>
		</div>
		<div class="login_drop">
			<span class="darw"></span>
			<section>
                <div class="login_forms">
                	<div id="login-forms-login">
                		<?php echo form_open($this->uri->uri_string(), $attributes)?>
							<div class="col2-set">
								<div class="col-2">
									<h3>Login</h3>
										<?php echo $this->dx_auth->get_auth_error(); ?>
										<ul class="form-list">
											<li>
												<label class="required fl_left" for="login-email">Username</label>
												<div class="input-box fl_left">
													<?php echo form_input($username)?>
												</div>
											</li>
											<li>
												<label class="required fl_left" for="login-password">Password</label>
												<div class="input-box fl_left">
													<?php echo form_password($password)?>
												</div>
											</li>
										</ul>
										<br/>
										<br/>
								</div>
							</div>
							<div class="col2-set">
								<div class="col-2">
									<div class="buttons-set">
										<a class="fl_left" href="#" id="login_forgetpassbtn">Forgot your password?</a>
										<?php echo form_submit($form_submits);?>
									</div>
								</div>
							</div>
                      	<?php echo form_close();?>
						<?php echo form_open($this->uri->uri_string(), $attributes_forget)?>
							<div class="col2-set">
								<div class="col-2">
									<h3>Forget Password</h3>
										<ul class="form-list">
											<li>
												<span>Enter&nbsp;your&nbsp;Username&nbsp;or&nbsp;Email&nbsp;Address</span>
												<br><br>
												<div class="input-box fl_left">
													<?php echo form_input($forget); ?> 
													<?php echo form_error($forget['name']); ?>
												</div>
											</li>
										</ul>
										<br/>
										<br/>
								</div>
							</div>
							<div class="col2-set">
								<div class="col-2">
									<div class="buttons-set">
										<a class="fl_left" href="#" id="login_viewbtn">Back to Login</a>
										<?php echo form_submit('reset', 'Reset Now'); ?>
									</div>
								</div>
							</div>
                      	<?php echo form_close();?>
					</div>
                </div>
        	</section>
		</div>
		<div class="signup_drop">
			<span class="darw"></span>
			<section>
                <div class="signup_forms">
                	<div id="signup-forms-signup">
                		<?php echo form_open(base_url() . 'auth/register', $attributes_reg)?>
                		<div class="col2-set">
                        	<div class="col-2">
                            	<h3>Register</h3>
                              		<ul class="form-list">
                                    	<li>
                                        	<label class="required fl_left" for="signup_username">Username</label>
                                            <div class="input-box fl_left">
                                            	<?php echo form_input($username_reg)?>
                                           	</div>
											<?php echo form_error($username_reg['name']); ?>
                                       	</li>
                                        <li>
                                        	<label class="required fl_left" for="signup_password">Password</label>
                                            <div class="input-box fl_left">
                                            	<?php echo form_password($password_reg)?>
                                         	</div>
											<?php echo form_error($password_reg['name']); ?>
                                      	</li>
										<li>
                                        	<label class="required fl_left" for="signup_confirm_password">Confirm&nbsp;Password</label>
                                            <div class="input-box fl_left">
                                            	<?php echo form_password($confirm_password_reg);?>
										 	</div>
											<?php echo form_error($confirm_password_reg['name']); ?>
                                      	</li>
										<li>
                                        	<label class="required fl_left" for="signup_email">Email</label>
                                            <div class="input-box fl_left">
                                            	<?php echo form_input($email_reg);?>
										 	</div>
											<?php echo form_error($email_reg['name']); ?>
                                      	</li>
										<!--<li>
                                            <div class="input-box fl_left">
												<?php if ($this->dx_auth->captcha_registration): ?>
												<dt></dt>
												<dd>
													<?php 
														echo $this->dx_auth->get_recaptcha_image(); 
														echo $this->dx_auth->get_recaptcha_reload_link(); 
														echo $this->dx_auth->get_recaptcha_switch_image_audio_link(); 
													?>
												</dd>

												<dt><?php echo $this->dx_auth->get_recaptcha_label(); ?></dt>
												<dd>
													<?php echo $this->dx_auth->get_recaptcha_input(); ?>
													<?php echo form_error('recaptcha_response_field'); ?>
												</dd>
												
												<?php 
													echo $this->dx_auth->get_recaptcha_html();
												?>
											<?php endif; ?>
										 	</div>
                                      	</li>-->
                               		</ul>
                                  	<br/>
                                    <br/>
                        	</div>
						</div>
						<div class="col2-set">
                         	<div class="col-2">
                             	<div class="buttons-set">
                                	<?php echo form_submit($form_submits_reg);?>
                            	</div>
                        	</div>
                      	</div>
                      	<?php echo form_close();?>
					</div>
                </div>
        	</section>
		</div>
		<h1 class="logo"> <a href="leisure_index.html"><img src="<?php echo base_url();?>assets/themes/leisure/images/logo.png" /></a> </h1>
		<div class="responsive-nav" style="display:none;">
			<select  onchange="if(this.options[this.selectedIndex].value != ''){window.top.location.href=this.options[this.selectedIndex].value}">
				<option selected="" value="">Navigate...</option>
				<option value="leisure_index.html"> Home</option>
				<option value="leisure_listing.html"> -  Listing Page</option>
				<option value="leisure_detail.html">Product Page</option>
				<option value="leisure_cart.html"> -  Shopping Cart</option>
				<option value="leisure_checkout.html"> -  Checkout</option>
				<option value="leisure_contact.php">Contact</option>
			</select>
		</div>
		<form class="header_search">
			<div class="form-search">
				<input id="search_text" type="text" name="q" value="" class="input-text" autocomplete="off" placeholder="Search">
				<button type="button" title="Search" id="button_submitsearch"></button>
			</div>
		</form>
	</header>
</div>
<script>
	$(document).ready(function(){
		$(".miniaccount_link").click(function(){
			my_config.main.load('index.php/c_account',function(){
				$("#main_content").load('index.php/c_account/v_userproduct');
			});
		});
		$("#button_submitsearch").click(function(){
			var key = $("#search_text").val();
			my_config.main.load('index.php/c_search?key=' + key);
		});
		$('#search_text').keypress(function(e) {
			if(e.which == 13) {
				var key = $("#search_text").val();
				my_config.main.load('index.php/c_search?key=' + key);
				return false;
			}
		});
		$("#forget-form").hide();
		$("#login_forgetpassbtn").click(function(){
			$("#login-form").hide();
			$("#forget-form").show();
		});
		$("#login_viewbtn").click(function(){
			$("#login-form").show();
			$("#forget-form").hide();
		});
	});
</script>